import request from '@/utils/request'

export default {

    //条件查询讲师
    pageTeacherCondition(current, limit, teacherQuery) {
        return request({
            url: `/eduservice/edu-teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            //teacherQuery条件对象，后端使用RequestBody获取数据..data以json格式
            // data: { teacherQuery }  这样写是不行的，查不出来？why
            data: teacherQuery
        })
    },
    //删除讲师
    removeTeacherById(id) {
        return request({
            url: `/eduservice/edu-teacher/${id}`,
            method: 'delete'
        })
    },
    //添加讲师
    addTeacher(teacher) {
        return request({
            url: `eduservice/edu-teacher/addTeacher`,
            method: 'post',
            data: teacher
        })
    },

    //根据id得到讲师信息
    getTeacherInfo(id) {
        return request({
            url: `/eduservice/edu-teacher/getTeacher/${id}`,
            method: 'get'
        })

    },

    //修改讲师
    updateTeacherInfo(teacher) {
        return request({
            url: '/eduservice/edu-teacher/modifyTeacher',
            method: 'put',
            data: teacher
        })

    }

}
